//用户相关的接口
import request from '@/utils/request'
import { LoginFrom, LoginResponseData, UserInfoResponseData } from './type'

//统一管理接口
enum API {
  LOGIN_URL = 'http://114.115.179.162:8022/prod-api/admin/acl/index/login',
  USERINFO_URL = 'http://114.115.179.162:8022/prod-api/admin/acl/index/info',
  LOGINOUT_URL = 'http://114.115.179.162:8022/prod-api/admin/acl/index/logout',
}

//暴露请求函数
export const reqLogin = (data: LoginFrom) =>
  request.post<any, LoginResponseData>(API.LOGIN_URL, data)
export const reqUserInfo = () =>
  request.get<any, UserInfoResponseData>(API.USERINFO_URL)
export const reqLogOut = () => request.post<any, any>(API.LOGINOUT_URL)
